package protocol.domain;

import java.io.Serializable;

/**
 * Class representing an instant message
 * 
 * @author hAmmeRoL
 * 
 */
public class InstantMessage implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	// the id the message is sent from
	private String fromID;

	// the id the message should be sent to
	private String destinationID;

	// the content of this message
	private String content;

	/**
	 * Construct an instant message
	 * 
	 * @precondition. none
	 * @postcondition. none
	 * @modifies. none
	 * 
	 * @param fromID
	 *            the if the message is sent from
	 * @param destinationID
	 *            the id the message should be sent to
	 * @param content
	 *            the content of the message
	 */
	public InstantMessage(String fromID, String destinationID, String content) {
		this.fromID = fromID;
		this.destinationID = destinationID;
		this.content = content;
	}

	public InstantMessage() {

	}

	/**
	 * Set the from id
	 * 
	 * @precondition. none
	 * @postcondition. from id is changed
	 * @modifies. from id
	 * 
	 * @param id
	 *            new from id
	 */
	public void setFromID(String id) {
		fromID = id;
	}

	/**
	 * Get the from id
	 * 
	 * @precondition. none
	 * @postcondition. none
	 * @modifies. none
	 * 
	 * @return from id
	 */
	public String getFromID() {
		return fromID;
	}

	/**
	 * Set the destination id
	 * 
	 * @precondition. none
	 * @postcondition. destination id changed
	 * @modifies. destination id
	 * 
	 * @param id
	 *            new destination id
	 */
	public void setDestinationID(String id) {
		this.destinationID = id;
	}

	/**
	 * Get the destination id
	 * 
	 * @precondition. none
	 * @postcondition. none
	 * @modifies. none
	 * 
	 * @return the destination id
	 */
	public String getDestinationID() {
		return destinationID;
	}

	/**
	 * Set the content of the message
	 * 
	 * @precondition. none
	 * @postcondition. content changed
	 * @modifies. content of the message
	 * 
	 * @param content
	 *            the new content
	 */
	public void setContent(String content) {
		this.content = content;
	}

	/**
	 * Get the content of the message
	 * 
	 * @precondition. none
	 * @postcondition. none
	 * @modifies. none
	 * 
	 * @return content of the message
	 */
	public String getContent() {
		return content;
	}
}
